package com.tengju.payment.domain.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;


//对公对私标识
@AllArgsConstructor
public enum AccountType {

    PERSON(1,"个人账户"),

    COMPANY(2,"对公账户");



    private int val;
    private String desc;

    @JsonValue
    public int getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    @JsonCreator
    public static AccountType fromVal(int val) {
        for (AccountType data : values()) {
            if (data.val == val) {
                return data;
            }
        }
        return null;
    }



}
